package main;

import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Font.FontFamily;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.pdf.ColumnText;
import com.itextpdf.text.pdf.GrayColor;
import com.itextpdf.text.pdf.PdfPageEventHelper;
import com.itextpdf.text.pdf.PdfWriter;

public class Watermark extends PdfPageEventHelper {
	Font font=new Font(FontFamily.HELVETICA,52,Font.BOLD,new GrayColor(0.75f));
	public void onEndPage (PdfWriter writer, Document document) {
        ColumnText.showTextAligned(    
                writer.getDirectContentUnder(),
                Element.ALIGN_CENTER,
                new Phrase(" watermovie",font),
                297.5f,
                421,
                writer.getPageNumber()%2==1?45:-45
        );
    }
}
